package com.dailyblue.java.project.bookstore.count.controller;

import com.dailyblue.java.project.bookstore.count.service.BookCountService;
import com.dailyblue.java.project.bookstore.count.util.JsonResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/count")
public class BookCountController {
    @Resource
    private BookCountService bookCountService;

    @GetMapping("/{bookId}")
    public JsonResult book(@PathVariable("bookId") int bookId) {
        return bookCountService.addBookCount(bookId);
    }
}
